<template>
  <view class="tabs-list">
    <view class="tabs-item" v-for="(item,index) in tabsList" :key="index" :class="{'active':index==curr}" @tap="itemClick(index)">
      {{item}}
    </view>
  </view>
</template>

<script>
  export default {
    props:{
      tabsList:{
        type:Array,
        default(){
          return []
        }
      }
    },
    data() {
      return {
        curr:0
      };
    },
    methods:{
      itemClick(index){
        this.curr=index;
				this.$emit('itemClick',index)
      }
    }
  }
</script>

<style lang="scss" scoped>
.tabs-list{
  height: 60upx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .tabs-item{
    font-size: 26upx;
  }
  .active{
    font-size: 32upx;
    color: #3c9cff;
  }
}
</style>
